package enums;

public enum CommentEnum {
	
	GOOD(1,"好评"),
	MIDDLE(2,"一般"),
	BAD(3,"差评")
	;
	
	private int state;
	private String info;

	CommentEnum(int state,String info){
		this.state=state;
		this.info=info;
	}
	
	public int getState(){
		return state;
	}
	public String getInfo(){
		return info;
	}
	
	public static CommentEnum StateOf(int index){
		for (CommentEnum commentEnum : values()) {
			if(commentEnum.getState()==index){
				return commentEnum;
			}
		}
		return null;
	}
	
}
